ScanFragment

open class ScanFragment : Fragment

Fragment managing the access to the camera and holding a preview.

The parent activity or fragment must implement the CameraCallbackProvider interface. The parent component also needs to initialize the camera by calling initializeCamera, usually in the onResume() method, after making sure the permission to use the camera has been granted.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
interface Callback
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
open fun initializeCamera()
Setup the camera and start the preview.
Link copied to clipboard
Link copied to clipboard
open fun onAttach(@NonNull context: Context)
Link copied to clipboard
open fun onCreateView(@NonNull inflater: LayoutInflater, container: ViewGroup, savedInstanceState: Bundle): View
Link copied to clipboard
open fun onPause()
Link copied to clipboard
open fun onViewCreated(@NonNull view: View, @Nullable savedInstanceState: Bundle)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Set a callback to receive barcode detection events.
Link copied to clipboard
Sets the listener receiving real-time border detection updates on the main thread.
Link copied to clipboard
Link copied to clipboard
open fun setFlashMode(@NonNull flashMode: FlashMode)
Set the camera flash mode.
Link copied to clipboard
open fun setFocusIndicator(@Nullable focusIndicator: FocusIndicator)
Link copied to clipboard
open fun setJpegQuality(jpegQuality: Int)
Set the JPEG quality of camera output pictures.
Link copied to clipboard
open fun setOverlayColor(colorResId: Int)
Link copied to clipboard
open fun setOverlayColorResource(@ColorRes colorResId: Int)
Link copied to clipboard
open fun setPreviewAspectFill(isAspectFill: Boolean)
Link copied to clipboard
open fun setPreviewEnabled(enabled: Boolean)
Link copied to clipboard
Link copied to clipboard
Stop the real-time border detection and capture the image The provided callback is invoked on the main thread.
Link copied to clipboard
Toggle the flash mode to the next available flash mode.